Attribute DXL for headings based on the child objects

Hi,

I would like to make an attribute dxl which sets each bottom level objects state, for example to "accepted" , "not accepted".

For the headings of each subgroup I would like to assign a state which is based on is child objects attribute, is there a way or work around for this?

Tried it simply solving it in an attribute dxl, but I think this cant work, since the child objects state isn't calculated yet. I also tried to use 2 dxl attributes, each one sets the state of child object dxl attribute and the heading states for the other, but this isnt stable since it seems that doors calculates dxl attributes from left-to-right, and the view effects the heading states.


valikund - Tue Sep 22 03:06:05 EDT 2015

Re: Attribute DXL for headings based on the child objects
pommCannelle - Tue Sep 22 04:07:15 EDT 2015

( Have you tried ti use a trigger ? :) )

Re: Attribute DXL for headings based on the child objects
valikund - Tue Sep 22 04:44:00 EDT 2015

pommCannelle - Tue Sep 22 04:07:15 EDT 2015

( Have you tried ti use a trigger ? :) )

Not yet.

What kind of trigger should I use?

 

Re: Attribute DXL for headings based on the child objects
pommCannelle - Tue Sep 22 09:01:50 EDT 2015

( post open module, or sync object ... only depends how many time you need to refresh your attribute ... 

Re: Attribute DXL for headings based on the child objects
valikund - Fri Sep 25 09:31:36 EDT 2015

pommCannelle - Tue Sep 22 09:01:50 EDT 2015

( post open module, or sync object ... only depends how many time you need to refresh your attribute ... 

If I choose to use the open module trigger, then should I incorporate the dxl scripts of the attribute dxl into it?

I think that it is risky using dxl attributes and triggers together, becouse the dxl attribute might be calculated after the trigger has been run.

Re: Attribute DXL for headings based on the child objects
pommCannelle - Fri Sep 25 10:06:12 EDT 2015

... hmmm ... 

my point of view was to use a trigger to do the job and to not use any dxl attribute.
You should use permanent trigger ... and take your time to test it really carefully ;)

If triggers are too tricky for You, You can use the DOORS directory structure too ... it depends on your deployment means o:)

Re: Attribute DXL for headings based on the child objects
llandale - Sat Sep 26 16:30:52 EDT 2015

Don't agree with the trigger solution.  Here is an attr-DXL solution.

// Attr-DXL.  If the object is a "Requirement" then calculate whether it is accepted or not accepted.

// If the object is not a requirement and has children objects, then this heading is "accepted" when all its children are accepted, otherwise it is "not accepted" (yet).

// If the object is not a requirement and also has no children, then it is "accepted".

string Result = "Accepted"   // unless Not Accepted below

Object oChild

if (obj is a Requirement)

{   if (obj is acceptable) //

    then Result = "Accepted"

    else Result = "Not Accepted"

}

else

{  for oChild in obj do

   {  if (oChild.attrDXLName != "Accepted")

      {  Result = "Not Accepted"

         break

      }

   }

}

obj.attrDXLName = Result

You need to decide if "requirement" is the correct check and also need to figure out what exactly is "acceptable".

Note that a non-requirement leaf, fails the 1st "if" statement but since it has no children, never enters the oChild loop.

Now you may not notice the implied recursion here.  When we query the value of oChild, it is calculated and the value returned and this this code continues.

-Louie